<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="ty" tagdir="/WEB-INF/tags"%>

<!DOCTYPE html>
<html lang="zh">
	<head>
		<%@ include file="../common/head.jsp" %>
		<title>编辑系统菜单-后台管理系统</title>
		<script type="text/javascript" src="/manager/js/systemMenu.js"></script>
	</head>
	<ty:right>
		<div class="page-header">
			<h1>编辑系统菜单</h1>
		</div>
		<form action="${empty menu ? 'add' : 'edit'}.action" forward="manage.action" 
			id="validForm" class="form-horizontal">
			<input type="hidden" name="id" id="id" value="${menu.id}" />
			
			<div class="form-group">
				<label class="col-sm-2 control-label no-padding-right">所属上级菜单：</label>
				<div class="col-sm-10">
					<select class="col-xs-10 col-sm-5" readonly="readonly" name="parent_id" 
						onclick="TuYou.TreeCombox(this)" url="getHierarchy.action">
						<option value="${empty parent.id ? null : parent.id}" checked="checked">
							${empty parent ? '顶层节点' : parent.name}
						</option>
					</select>
			        <span class="validform_tip control-label">请选择上级菜单</span>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label no-padding-right">菜单名称：</label>
				<div class="col-sm-10">
			        <input type="text" id="name" name="name" class="col-xs-10 col-sm-5" datatype="*2-20" value="${menu.name}"/>
					<span class="validform_tip control-label">请填写菜单名称</span>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label no-padding-right">菜单链接：</label>
				<div class="col-sm-10">
			        <input type="text" id="url" name="url" class="col-xs-10 col-sm-5" datatype="*1-255" value="${menu.url}"/>
					<span class="validform_tip control-label">请填写菜单链接</span>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label no-padding-right">菜单图标：</label>
				<div class="col-sm-10">
			        <input type="text" id="icon" name="icon" class="col-xs-10 col-sm-5" datatype="*1-20" value="${empty menu.icon ? 'coffee' : menu.icon}"/>
					<span class="validform_tip control-label">请填写菜单图标</span>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label no-padding-right">菜单排序值：</label>
				<div class="col-sm-10">
			        <input type="text" id="orderValue" name="orderValue" class="col-xs-10 col-sm-5" datatype="n1-10" value="${menu.orderValue}"/>
					<span class="validform_tip control-label">请填写菜单排序值</span>
				</div>
			</div>
			<div class="clearfix">
				<div class="col-md-offset-3 col-md-9"> 
					<button type="submit" class="btn btn-info" type="button">
						<i class="ace-icon fa fa-check bigger-110"></i>
						提交
					</button>
					<button id="returnBtn" type="button" class="btn btn-info" type="button">
						<i class="ace-icon fa fa-close bigger-110"></i>
						取消
					</button>
				</div>
			</div>
		</form>
	</ty:right>
</html>